package com.scala.oop.classDemo

/**
 * Created by Administrator on 2018/1/27/027.
 */
class SetDemo {
  private var myAge = 22
  def age_=(newAge:Int): Unit ={
    if(newAge>0) {
      myAge = newAge
    }else{
      println("怎么可能年龄＜0ne呢")
    }
  }
  def older(s:HelloWorld) ={
    myAge > s.age
  }
}
